package com.dragon.modules.yuegou.service.wallet;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dragon.common.web.PageRequest;
import com.dragon.modules.yuegou.entity.wallet.MerchantWalletEntity;
import com.dragon.modules.yuegou.model.merchant.User;
import com.dragon.modules.yuegou.model.wallet.MerchantWallet;

import java.math.BigDecimal;

/**
 * 商户钱包 服务接口
 *
 * @author pbuilder generated
 * @date 2019-05-07 09:09:32
 * @version 2.0
 */
public interface MerchantWalletService extends IService<MerchantWalletEntity> {

    /**
     * 订单消费后，计算商户钱包
     * @param orderNo
     */
    void merchantWallet(String orderNo);
	/**
	 * 查询商户可提现余额
	 * */
	MerchantWallet withdrawalAmount(String merchantId);

    /**
     * 获取商户钱包
     *
     * @param merchantId 商户ID
     * @return 商户钱包
     */
    MerchantWallet loadByMerchant(String merchantId);
    
    /**
     * 获得商户信息
     * */
    User getMerchanPass(String id);


    /**
     * 大运营商户账户查询
     * @param page
     * @param merchantName
     * @return
     */
    IPage<MerchantWallet> search(PageRequest page, String busdId, String merchantName);

     IPage<MerchantWallet> searchList(PageRequest page, String busdId, String merchantName);

    /**
     * 验证商户密码是否正确
     * */
	Boolean verifyPay(String merchantId, String payPassword);

    /**
     * 将所有商户账号都清零
     */
    void modifyAllAmount();

    /**
     *  提现减钱包
     * @param id
     * @param withdrawWechatAmount
     * @param withdrawAlipayAmount
     * @return
     */
    int modifyWallet(String id, BigDecimal withdrawWechatAmount, BigDecimal withdrawAlipayAmount);

    /**
     *  回退钱包
     * @param id
     * @param withdrawWechatAmount
     * @param withdrawAlipayAmount
     * @return
     */
    int modifyWalletBack(String id, BigDecimal withdrawWechatAmount, BigDecimal withdrawAlipayAmount);
}